<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

//添加好友关系表
class UserRelation extends Model
{
    //
    protected $table = 'user_relation';
    protected $fillable = [
        'user_id',
        'friend_id',
        'created_at',
        'updated_at',
        'type',
    ];

    const TYPE = [
        0 =>'手动添加', //默认
        1 => '邀请添加'
    ];

    public function user(){
        return $this->belongsTo(User::class);
    }
}
